-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix Incomplete Markdown Rendering and Styling Issues in Chat Messages #2532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
The pull request includes changes across 37 files, with 387 lines added and 138 lines removed. It seems to encompass several distinct themes:
If these changes are not interdependent, it might be beneficial to split them into separate pull requests:
This could help in reviewing and testing each aspect more thoroughly. Please consider if these changes can be logically separated and if so, splitting them into smaller pull requests. |
mrubens
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Could you please separate out these changes from the hiddenBuiltInModes changes?
…y or another symbolic link (RooCodeInc#2513) * read symbolic linked dir and files recursively * add symlinked dir and nested symlink test case for custom-instructions * enhance comments * add changeset
* changeset version bump * Updating CHANGELOG.md format * Update CHANGELOG.md --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: R00-B0T <[email protected]> Co-authored-by: Matt Rubens <[email protected]>
cd64f70 to
64d0a72
Compare
Fixed that. |
Context
The Markdown rendering previously used for chat messages (primarily via
ChatRow.tsx) was incomplete and failed to render several standard Markdown elements correctly. Notably, list markers (both unordered bullets and ordered numbers) were not displayed, and GFM elements like tables appeared as unformatted plain text.After switching to a more standard-compliant Markdown renderer (
@/components/ui/markdown/Markdown.tsx) to address these fundamental rendering issues, further visual inconsistencies were observed compared to the previous implementation. These included differences in list indentation depth, bold text weight, and the styling (background, font, padding, border, alignment) of inline code blocks.The primary root cause was the use of an incomplete and non-standard Markdown renderer (
MarkdownBlock.tsx) in the main chat message rendering path. Secondary styling issues arose from the inherent visual differences between the oldstyled-components-based styling and the new Tailwind CSS-based styling after switching to the standard renderer.Implementation
@/components/common/MarkdownBlock.tsx: Usedreact-remarkandstyled-components. This implementation lacked complete CommonMark support (missing list markers) and GFM support (no tables). It had custom styling, auto-URL linking, and Mermaid support.@/components/ui/markdown/Markdown.tsx: Usesreact-markdownwithremark-gfmand Tailwind CSS. Provides more robust and standard-compliant Markdown rendering, including GFM features.ChatRow.tsx, responsible for rendering many chat messages, was incorrectly relying on the limitedMarkdownBlock.tsximplementation.ChatRow.tsxto consistently use the shared, standard-compliant@/components/ui/markdown/Markdown.tsxcomponent. This resolved the fundamental rendering issues for lists, tables, and other standard elements.@/components/ui/markdown/Markdown.tsxcomponent to address visual discrepancies introduced by the renderer switch. Adjustments included list indentation (pl-[2.5em]), bold weight (font-semibold), inline code styling (background, color, padding, border, font, alignment), and ensuring the base font size usesvar(--vscode-font-size).ChatRow.tsx's local wrapper) by creating a new wrapper component (MarkdownWithCopy) withinChatRow.tsxaround the shared<Markdown />component. This restored specific UI interactions and layout nuances desired for chat messages.The solution involved replacing the deficient renderer with a standard-compliant one (
react-markdown+remark-gfm), unifying the Markdown implementation used byChatRow.tsx. Subsequently, styles were adjusted in the shared component, and specific UI features/layout wrappers were reintroduced in the calling component (ChatRow.tsx) to achieve functional and visual consistency with the intended design.Screenshots
before:

after:

before:

after:

How to Test
To Reproduce
Steps to reproduce the behavior:
ChatRow.tsx).Expected behavior
font-semibold).--vscode-textCodeBlock-background), appropriate padding, border, font, and alignment consistent with the surrounding text.Get in Touch
[email protected]
Important
Refactor chat message Markdown rendering to use a unified component with GFM support, adjust styles for consistency, and restore specific UI features.
ChatRow.tsxto use@/components/ui/markdown/Markdown.tsxfor consistent Markdown rendering with GFM table support.Markdown.tsxfor list indentation, bold text, and inline code blocks.ChatRow.tsxusingMarkdownWithCopywrapper.hiddenBuiltInModesstate toExtensionStateContext.tsxand related files to manage visibility of built-in modes.ChatTextArea.test.tsxandPromptsView.test.tsxto reflect changes in Markdown rendering and state management.This description was created by
for ae6b5754192d17a0a6cfa03bc7a1ebd4362c3a96. It will automatically update as commits are pushed.